import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

ApplicationWindow {
    id: mainWindow
    width: 800
    height: 600
    visible: true
    title: "Graphical Effects Demo"
    color: "#FFF"

    RowLayout {
        anchors.fill: parent

        // 左侧导航栏
        ListView {
            id: navList
            Layout.preferredWidth: 180
            Layout.fillHeight: true
            model: ListModel {
                ListElement { name: "色阶调整"}
                ListElement { name: "伽马调整"}
                ListElement { name: "置换效果"}
                ListElement { name: "遮罩效果"}
                ListElement { name: "模糊效果"}
                ListElement { name: "阴影效果"}
                ListElement { name: "发光矩形"}
                ListElement { name: "发光效果"}
                ListElement { name: "亮度对比度"}
                ListElement { name: "颜色效果"}
                ListElement { name: "渐变效果"}
                ListElement { name: "混合效果"}
            }

            delegate: Rectangle {
                width: parent.width
                height: 40
                color: ListView.isCurrentItem ? "#BCE6FF": "#FFF"
                border.width: 0

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        parent.ListView.view.currentIndex = index
                        contentStack.currentIndex = index
                    }
                }

                Text {
                    anchors.fill: parent
                    anchors.margins: 10
                    text: name
                    color: "#333"
                    font.pixelSize: 14
                    font.bold: true
                }
            }
        }

        // 右侧内容区
        StackLayout {
            id: contentStack
            Layout.fillWidth: true
            Layout.fillHeight: true

            // 这里按顺序放各个效果组件
            LevelAdjustDemo {}
            GammaAdjustDemo {}
            DisplaceEffect {}
            MaskEffect {}
            BlurEffect {}
            DropShadowEffect {}
            RectangularGlowEffect {}
            GlowEffect {}
            BrightnessEffect {}
            ColorEffect {}
            GradientEffect {}
            BlendEffect {}
        }
    }
}
